using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Web;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace WebRSSBuilder.Core
{
   /// <summary>
   /// An RSS news feed.
   /// </summary>
   public class RSSFeed: INotifyPropertyChanged
   {
       #region Private Data Members
       private string title = "";
       private string link = "";
       private string webURL = "";
       private string managingEditor = "";
       private string copyright = "";
       private string language = "en-us";
       private string editor = "";
       private string webmaster = "";
       private string description = "";
       private string imgURL = "";
       private string imgTitle = "";
       private string imgLink = "";
       private string subject = "";
       private DateTime pubDate;
       private DateTime lastBuildDate;
       private string ftpSite = "";
       private string styleSheet = "";
       private string styleType = "";
       private string filename = "";
       private string category = "";
       private string generator = "";
       private string docs = "";
       private string cloudDomain = "";
       private string cloudRegisterProcedure= "";
       private string cloudProtocol = "";
       private string cloudPort = "";
       private string cloudPath = "";
       private string ttl = "";
       private string rating = "";
       private string textInput = "";
       private string skipDays = "";
       private ObservableCollection<RSSItem> items = new ObservableCollection<RSSItem>();
       private string skiphours = ""; 
       #endregion

       #region Properities
       public string Title
       {
           get { return title; }
           set { title = value; OnPropertyChanged("Title"); }
       }

       public string Generator
       {
           get { return this.generator; }
           set { this.generator = value; OnPropertyChanged("Generator"); }
       }

       public string Docs
       {
           get { return this.docs; }
           set { this.docs = value; OnPropertyChanged("Docs"); }
       }

       public string CloudDomain
       {
           get { return this.cloudDomain; }
           set { this.cloudDomain = value; OnPropertyChanged("CloudDomain"); }
       }

       public string CloudPort
       {
           get { return this.cloudPort; }
           set { this.cloudPort = value; OnPropertyChanged("CloudPort"); }
       }

       public string CloudPath
       {
           get { return this.cloudPath; }
           set { this.cloudPath = value; OnPropertyChanged("CloudPath"); }
       }

       public string CloudRegisterProcedure
       {
           get { return this.cloudRegisterProcedure; }
           set { this.cloudRegisterProcedure = value; OnPropertyChanged("CloudRegisterProcedure"); }
       }

       public string CloudProtocol
       {
           get { return this.cloudProtocol; }
           set { this.cloudProtocol = value; OnPropertyChanged("CloudProtocol"); }
       }

       public string Ttl
       {
           get { return this.ttl; }
           set { this.ttl = value; OnPropertyChanged("Ttl"); }
       }

       public string Rating
       {
           get { return this.rating; }
           set { this.rating = value; OnPropertyChanged("Rating"); }
       }

       public string TextInput
       {
           get { return this.textInput; }
           set { this.textInput = value; OnPropertyChanged("TextInput"); }
       }

       public string SkipDays
       {
           get { return this.skipDays; }
           set { this.skipDays = value; OnPropertyChanged("SkipDays"); }
       }

       public string SkipHours
       {
           get { return this.skiphours; }
           set { this.skiphours = value; OnPropertyChanged("SkipHours"); }
       }

       public string Link
       {
           get { return this.link; }
           set { this.link = value; OnPropertyChanged("Link"); }
       }

       public string Category
       {
           get { return this.category; }
           set { this.category = value; OnPropertyChanged("Category"); }
       }

       public string ManagiongEditor
       {
           get { return this.managingEditor; }
           set { this.managingEditor = value; OnPropertyChanged("ManagiongEditor"); }
       }

       public string WebURL
       {
           get { return webURL; }
           set { webURL = value; OnPropertyChanged("WebURL"); }
       }

       public string Copyright
       {
           get { return copyright; }
           set { copyright = value; OnPropertyChanged("Copyright"); }
       }
       public string Language
       {
           get { return language; }
           set { language = value; OnPropertyChanged("Language"); }
       }
       public string Editor
       {
           get { return editor; }
           set { editor = value; OnPropertyChanged("Editor"); }
       }
       public string Webmaster
       {
           get { return webmaster; }
           set { webmaster = value; OnPropertyChanged("Webmaster"); }
       }
       public string Description
       {
           get { return description; }
           set { description = value; OnPropertyChanged("Description"); }
       }
       public string ImgURL
       {
           get { return imgURL; }
           set { imgURL = value; OnPropertyChanged("ImgURL"); }
       }

       public string ImgTitle
       {
           get { return imgTitle; }
           set { imgTitle = value; OnPropertyChanged("ImgTitle"); }
       }

       public string ImgLink
       {
           get { return imgLink; }
           set { imgLink = value; OnPropertyChanged("ImgLink"); }
       }


       public string FtpSite
       {
           get { return ftpSite; }
           set { ftpSite = value; OnPropertyChanged("FtpSite"); }
       }

       public string StyleSheet
       {
           get { return styleSheet; }
           set { styleSheet = value; OnPropertyChanged("StyleSheet"); }
       }

       public string StyleType
       {
           get { return styleType; }
           set { styleType = value; OnPropertyChanged("StyleType"); }
       }

       public string Subject
       {
           get { return this.subject; }
           set { this.subject = value; OnPropertyChanged("Subject"); }
       }
       public DateTime PubDate
       {
           get { return this.pubDate; }
           set { this.pubDate = value; OnPropertyChanged("PubDate"); }
       }
       public DateTime LastBuildDate
       {
           get { return this.lastBuildDate; }
           set { this.lastBuildDate = value; OnPropertyChanged("LastBuildDate"); }
       }
       public string FileName
       {
           get { return this.filename; }
           set { this.filename = value; OnPropertyChanged("FileName"); }
       }

       public ObservableCollection<RSSItem> Items 
       {
           get { return this.items; }
           set { this.items = value; OnPropertyChanged("Items"); }
       }
       #endregion

       #region Constructor
       public RSSFeed()
       {
           Items = new ObservableCollection<RSSItem>();
           Items.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(items_CollectionChanged);
       }
       #endregion
       
       #region Indexer
       public RSSItem this[int index]
       {
           get
           {
               if (index < Items.Count)
                   return (RSSItem)Items[index];
               else
                   return null;
           }
       } 
       #endregion
       
       #region INotifyPropertyChanged
       public event PropertyChangedEventHandler PropertyChanged;
       public void OnPropertyChanged(string PropertyName)
       {
           if (PropertyChanged != null)
               PropertyChanged(this,new PropertyChangedEventArgs(PropertyName)); 
       }
       void items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
       {
           OnPropertyChanged("Items");
       } 
       #endregion
   } 
} 
